

*** Who Buys The Big Lie??? Filindra et al. (2023) 

*** 2012, 2016, and 2020 ANES *** STATA CODING & ANALYSIS DO FILES

*********************** 2020 WEIGHTS **********************************

gen wgt_2020=V200010b
gen year=2020

************************* 2020 DEMOGRAPHICS **************************

*** RACE *** (Uses a Pre-quex Summary Variable)
gen white=.
replace white=0 if V201549x!=1 
replace white=1 if (V201549x==1 & V201546!=1)


*** AGE ***
gen age1829=.
replace age1829=0 if V201507x > 29
replace age1829=1 if V201507x < 30

gen age3044=0
replace age3044=1 if V201507x > 29 & V201507x < 45

gen age4564=0
replace age4564=1 if V201507x > 44 & V201507x < 65

gen age65p=0
replace age65p=1 if V201507x>=65

*** GENDER ***
gen female=. 
replace female=0 if V201600==1
replace female=1 if V201600==2

gen male=1-female

*** EDUCATION ***
gen ba=.
replace ba=0 if V201511x < 4
replace ba=1 if V201511x > 3 

recode V201511x (-9/-8=.) (-2=.)
gen degree=(V201511x-1)/4

*** INCOME ***
*Using pre/post-quex summary
gen income=(V202468x-1)/21 
replace income=0 if V202468x==-9 | V202468x==-5

gen incdk=0
replace incdk=1 if V202468x==-9 | V202468x==-5

*** PARTY ID ***
recode V201231x (-9/-8=.)
gen pid1=(V201231x-1)/6
tab pid1

gen gop=1 if pid1>.5
replace gop=0 if pid1<.5 |pid1==.5
tab gop pid1

gen pid3=0 if pid1==.5
replace pid3=-1 if pid1<.5
replace pid3=1 if pid1>.5
tab pid3 pid1

*** IDEOLOGY ***
*Var IDEOL_DUM aggregates responses from V201200 and V201201
*into one scale
*Var IDEOLOGY codes IDEOL_DUM on a 0-1 scale where 
*0=Extremely Liberal, 0.5=Moderate, and 1=Extremely Conservative
gen ideol_dum=.
replace ideol_dum=1 if V201200==1
replace ideol_dum=2 if V201200==2 | V201201==1
replace ideol_dum=3 if V201200==3 
replace ideol_dum=4 if V201201==3
replace ideol_dum=5 if V201200==5 
replace ideol_dum=6 if V201200==6 | V201201==2
replace ideol_dum=7 if V201200==7 
tab ideol_dum V201200
tab ideol_dum V201201

gen ideol1=(ideol_dum-1)/6
tab ideol1

*Ideology dk
gen ideoldk=0
replace ideoldk=1 if V201200==-9 | V201200==-8 | V201200==99 

*** PROTESTANT ***
* V201435: RESPONDENT MAJOR RELIGIOUS GROUP
gen prot=0
replace prot=1 if V201435==1 

************************* 2020 PERSONALITY **************************

*** AUTHORITARIANISM ***
*Higher values means more authoritarian
* V202266     N1a. Qualities for children: Independent or respect elders
* V202267     N1b. Qualities for children: Curiosity or good manners
* V202268     N1c. Qualities for children: Obedience or self-reliance
* V202269     N1d. Qualities for children: Considerate or well behaved

recode V202266 V202267 V202268 V202269 (-9/-7=.)(-6/-5=.)
gen auth1=(V202266-1)/1 if V202266 < 3
tab V202266 auth1

gen auth2=(V202267-1)/1 if V202267 < 3
tab V202267 auth2

gen auth3=(2-V202268)/1 if V202268 < 3
tab V202268 auth3

gen auth4=(V202269-1)/1 if V202269 < 3
tab V202269 auth4

pwcorr auth1 auth2 auth3 auth4
factor auth1 auth2 auth3 auth4
rotate
factor auth1 auth2 auth3 auth4, fac(2)
rotate
factor auth1 auth2 auth3 auth4, fac(3)
rotate
factor auth1 auth2 auth3 auth4, fac (4)
rotate

*Alpha (Scale reliability coefficient) = 0.66
alpha auth1 auth2 auth3 auth4
egen authf=rowmean(auth1 auth2 auth3 auth4)
tab authf


************************* 2020 RACIAL ATTITUDES **************************

*** NEGATIVE STEREOTYPES *** 
*Coded so that 1 = Group is Lazy/Violent

* WHITES LAZY
recode V202515 (-9/-5=.) (-7/-6=.)
gen wht_lazy=(V202515-1)/6 
label value wht_lazy wht_lazyL
label var wht_lazy "Whites are Lazy"
tab V202515 wht_lazy
sum wht_lazy

* BLACKS LAZY
recode V202516 (-9/-5=.) (-7/-6=.)
gen blk_lazy=(V202516-1)/6
label value blk_lazy blk_lazyL
label var blk_lazy "Blacks are Lazy"
sum blk_lazy

* WHITES VIOLENT
recode V202521 (-9/-5=.) (-7/-6=.)
gen wht_viol=(V202521-1)/6 
label value wht_viol wht_violL
label var wht_viol "Whites are Violent"
sum wht_viol

* BLACKS VIOLENT
recode V202522 (-9/-5=.) (-7/-6=.)
gen blk_viol=(V202522-1)/6 
label value blk_viol blk_violL
label var blk_viol "Blacks are Violent"
sum blk_viol

*Black Negative Stereotype Index
*alpha=.7154
alpha blk_lazy blk_viol
egen blk_stypes=rowmean (blk_lazy blk_viol)
label value blk_stypes blk_stypesL
label var blk_stypes "Negative Black Stereotypes"
sum blk_stypes
gen blackster=blk_stypes

*** SYMBOLIC RACISM/RACIAL RESENTMENT ***
*V202300 POST: AGREE/DISAGREE: BLACKS SHOULD WORK THEIR WAY UP WITHOUT SPECIAL FAVORS
*V202301 POST: AGREE/DISAGREE: PAST SLAVERY & DISCRIMINATION MAKE IT DIFFICULT FOR BLACKS
*V202302 POST: AGREE/DISAGREE: BLACKS HAVE GOTTEN LESS THAN THEY DESERVE
*V202303 POST: AGREE/DISAGREE: IF BLACKS TRIED HARDER THEY'D BE AS WELL OFF AS WHITES

recode V202300 V202301 V202302 V202303 (-9/-8=.) (-7/-6=.) (-5=.) 
gen black1=(5-V202300)/4
gen black2=(V202301-1)/4
gen black3=(V202302-1)/4
gen black4=(5-V202303)/4

*alpha=.8829
alpha black1 black2 black3 black4
egen symrace=rowmean(black1 black2 black3 black4)

*Unweighted Mean=0.45
sum symrace

*** BLACK FEELING THERMOMETER ***
recode V202480(-9=.) (-7/-6=.) (-5/-4=.)
gen blacktherm1=V202480/100 
label value blacktherm1 blackthermL
label var blacktherm1 "Black Thermometer"
sum blacktherm1

********************** 2020 XENOPHOBIA **************************

*** IMMIGRATION LEVELS *** coded so that 1 = xenophobic/favors decreased imm levels
recode V202232 (-9/-5=.)
gen immg=(V202232-1)/4
tab immg

***Muslim thermometer
recode V202168 (-9/-4=.)
recode V202168 (998=.)
gen muslimtherm=V202168/100

***Latino thermometer
recode V202479 (-9/-4=.) 
recode V202479 (998=.)
gen latinotherm=V202479/100

*ILLEGAL IMMIGRANT THERMOMETER
recode V202481 (-9/-4=.) 
recode V202481 (998=.)
gen illegaltherm=V202481/100


*********************** 2020 WHITENESS *************************

***WHITE FEELING THERMOMETER***
recode V202482 (-9/-7=.)(-6/-5=.) (-4=.)
gen whitetherm=V202482
gen whitetherm1=V202482/100

***WHITE DISCRIMINATION***
* V202530 - How much discrimination is there in the US today against whites
* 5 point scale -* coded so that higher values = "a great deal" 
recode V202530 (-9/-7=.)(-6/-5=.) 
gen whtdiscrim=(5-V202530)/4

xtile whtdiscrim_4=whtdiscrim, nq(4)
tabstat whtdiscrim, stat (n mean min max sd p50) by (whtdiscrim_4)
label var whtdiscrim_4 "white discrimination quartiles"

***WHITE IDENTITY (2012-2020 only)***
* V202499x - How important is being White to identity (avail 2012-2020 only) 
* coded so that 1 = VERY important
recode V202499x (-9/-1=.)
gen whiteid=(5-V202499x)/4

******************** 2020 GOVERNMENT & INSTITUTIONS *****************

*** TRUST IN PEOPLE ***
* How often can people be trusted?
recode  V201237 (-9/-8=.)   
gen trustpf=(5-V201237)/4

********************* 2020 VOTING & ELECTIONS ********************

*** ELECTION FAIRNESS *** Coded so that 1 refelcts trust in a fair system
* V202219 -  How often are votes counted fairly
* V201351 - Are votes counted accurately
* V201352 - How much can you trust local election officials
* V201353 - How often are people denied the right to vote

recode V202219 V201351 V201352 V201353 (-9/-8=.)(-7/-6=.) (-5=.)
gen votefair=(5-V202219)/4
gen voteaccurate=(V201351-1)/4
gen trustelect=(V201352-1)/4

gen denyvote=(5-V201353)/4

pwcorr votefair voteaccurate trustelect denyvote
* deny vote is negatively correlated with the others

alpha votefair voteaccurate trustelect
*alpha= .71 

**index
egen elections_fair=rowmean(votefair voteaccurate trustelect)
sum elections_fair
*mean= .6

*** CONSPIRACISM ***
gen conspir1=V202311 
gen conspir2=V202312
recode conspir1  conspir2 (-9/-2=.)
gen consp1=(conspir1-1)/4
gen consp2=(conspir2-1)/4


*************************************************************************************************************************************

************************************** 2020 MODELS ***********************************************************************************

*** Models white grievance (PID continuous)

eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
coefplot, drop(_cons) xline(0)
eststo: reg voteaccurate whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
coefplot, drop(_cons) xline(0)
eststo: reg trustelect whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
coefplot, drop(_cons) xline(0)


**** Models with white identity-Appendix Table Axx

eststo: reg votefair whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg voteaccurate whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg trustelect whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg voteaccurate whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg trustelect whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]


**** Models with multiple out-group measures

factor symrace blackster whitetherm1 whtdiscrim whiteid illegaltherm latinotherm muslimtherm immg if white==1, fac (2)
rotate

eststo: reg votefair c.whtdiscrim blackster trustpf authf c.pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg voteaccurate c.whtdiscrim blackster trustpf authf c.pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg voteaccurate c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg trustelect whtdiscrim blackster trustpf authf pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg trustelect c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]

**Robustness Checks R&R 

eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whtdiscrim symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whtdiscrim whiteid whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whtdiscrim whiteid whitetherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm latinotherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm latinotherm illegaltherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt_2020]

rreg votefair i.whtdiscrim_4 blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 
margins whtdiscrim_4
marginsplot


**************************************************************************************************************************

*********************** 2016 WEIGHTS **********************************

* for full, weight using post election variables V160102.
* for full, weight using pre election variables only V160101.
gen wgt=V160102

* tab mode of interview
tab V160501
gen imode=V160501-1

* weights by mode of interview
gen ftfwgt=V160102f
gen webwgt=V160102w

************************* 2016 DEMOGRAPHICS **************************

*** RACE ***
gen white=0
replace white=1 if  V161310x==1
replace white=. if  V161310x==-9

*** AGE ***
gen age1829=0
replace age1829=1 if V161267>17  & V161267<30
replace age1829=. if V161267==-8 | V161267==-9

gen age3044=0
replace age3044=1 if V161267>29  & V161267<45
replace age3044=. if V161267==-8 | V161267==-9

gen age4564=0
replace age4564=1 if V161267>44  & V161267<65
replace age4564 =. if V161267==-8 | V161267==-9

gen age65p=0
replace age65p=1 if V161267>64
replace age65p=. if V161267==-8 | V161267==-9

*** GENDER ***
* V161002 is gender as observed in FtF by interviewer; could use, but not doing so initially
gen female=0
replace female=1 if V161342==2
replace female=. if V161342==-9 | V161342==3
replace female=0 if V161342==-9 & V161002==1
replace female=1 if V161342==-9 & V161002==2

gen male=1-female

*** EDUCATION ***
gen ba=0
replace ba=1 if V161270==13 | V161270==14 | V161270==15 | V161270==16

gen degree5=0
replace degree5=1 if V161270==9
replace degree5=2 if V161270==10 | V161270==11  | V161270==12
replace degree5=3 if V161270==13
replace degree5=4 if V161270==14 | V161270==15  | V161270==16
replace degree5=. if V161270==-9  | V161270==95

gen degree=degree5/4

*** INCOME ***
gen income=(V161361x-1)/27
replace income=0 if V161361x==-8 | V161361x==-9 

gen incdk=0
replace incdk=1 if V161361x==-9 | V161361x==-5

*** PARTY ID ***
* pid pre V161158x
gen partyid=V161158x-1
replace partyid=. if V161158x==-8 | V161158x==-9
gen pid1=partyid/6

gen gop=1 if pid1>.5
replace gop=0 if pid1<.5 |pid1==.5
tab pid1 gop

gen pid3=0 if pid1==.5
replace pid3=-1 if pid1<.5
replace pid3=1 if pid1>.5
tab pid3 pid1

*** IDEOLOGY ***
* lots of imputation
* when pressed in follow-up question, if say liberal or conservative, recode as liberal (1) or conservative (5)

gen ideoldk=0

gen ideology=V161126-1
replace ideology=1 if V161126==4 & V161127==1
replace ideology=5 if V161126==4 & V161127==2

replace ideology=1 if V161126==99 & V161127==1
replace ideology=3 if V161126==99 & V161127==3
replace ideology=5 if V161126==99 & V161127==2

replace ideology=0 if V161126==99 & V161127==-8
replace ideology=0 if V161126==99 & V161127==-9

replace ideoldk=1 if V161126==99 & V161127==-8
replace ideoldk=1 if V161126==99 & V161127==-9

replace ideology=1 if V161126==-8 & V161127==1
replace ideology=3 if V161126==-8 & V161127==3
replace ideology=5 if V161126==-8 & V161127==2

replace ideology=1 if V161126==-9 & V161127==1
replace ideology=3 if V161126==-9 & V161127==3
replace ideology=5 if V161126==-9 & V161127==2

replace ideology=0 if V161126==-8 & V161127==-8
replace ideology=0 if V161126==-8 & V161127==-9
replace ideology=0 if V161126==-9 & V161127==-8
replace ideology=0 if V161126==-9 & V161127==-9

replace ideoldk=1 if V161126==-8 & V161127==-8
replace ideoldk=1 if V161126==-8 & V161127==-9
replace ideoldk=1 if V161126==-9 & V161127==-8
replace ideoldk=1 if V161126==-9 & V161127==-9

gen ideol1=ideology/6


*** PROTESTANT ***
gen prot=0
replace prot=1 if V161247a==1  | V161247b==1

gen nprot=0
replace nprot=1 if V161247a==1

************************* 2016 PERSONALITY **************************

*** AUTHORITARIANISM ***
* V162239 - Qualities for children: Independent or respect elders
* V162240 - Qualities for children: Curiosity or good manners
* V162241 - Qualities for children: Obedience or self-reliance
* V162242 - Qualities for children: Considerate or well behaved

recode V162239 V162240 V162241 V162242 (-9/-6=.)

gen auth1=0.5
replace auth1=0 if V162239==1
replace auth1=1 if V162239==2

gen auth2=0.5
replace auth2=0 if V162240==1
replace auth2=1 if V162240==2

gen auth3=0.5
replace auth3=0 if V162241==2
replace auth3=1 if V162241==1

gen auth4=0.5
replace auth4=0 if V162242==1
replace auth4=1 if V162242==2

sum auth1 auth2 auth3 auth4
pwcorr auth1 auth2 auth3 auth4
egen authf=rowmean(auth1 auth2 auth3 auth4)


************************ 2016 RACIAL ATTITUDES *************************

*** SYMBOLIC RACISM/RACIAL RESENTMENT ***
* V162211 - blacks shd work way up like other groups and w/o special favors
* V162212 - past slavery make more diff for blacks
* V162213 - blacks have gotten less than deserve
* V162214 - blacks must try harder to get ahead

recode V162211 V162212 V162213 V162214 (-9/-6=.)
gen black1=(5-V162211)/4
gen black2=(V162212-1)/4
gen black3=(V162213-1)/4
gen black4=(5-V162214)/4

sum black1 black2 black3 black4
pwcorr black1 black2 black3 black4
egen symrace=rowmean(black1 black2 black3 black4)

*** BLACK FEELING THERMOMETER ***
* V162312 - Using the thermometer scale 0-100, how would you rate blacks
recode V162312 (-9/-6=.) (-5=.)
gen blacktherm=V162312
gen blacktherm1=V162312/100

*** NEGATIVE STEREOTYPES ***

* Whites Lazy
recode V162345 (-9/-5=.)
gen wht_lazy=(V162345-1)/6

* Blacks Lazy
recode V162346 (-9/-5=.)
gen blk_lazy=(V162346-1)/6

* Whites Violent
recode V162349 (-9/-5=.)
gen wht_viol=(V162349-1)/6

* Blacks Violent
recode V162350 (-9/-5=.)
gen blk_viol=(V162350-1)/6

*Negative Stereotype Index Variables
egen whitester=rowmean(wht_lazy wht_viol)
egen blackster=rowmean(blk_lazy blk_viol)

* Here, we code for difference between white and black indexed stereotypes
gen difstereo=blackster-whitester
gen difstereo1=(blackster-whitester+1.25)/2.41

*** POLITICAL INFLUENCE *** (1 = TOO MUCH)

* BLACK INFLUENCE - V162323 - How much influence do blacks have in U.S. politics
recode V162323 (-9/-5=.)
gen blk_influence=(3-V162323)/2

* WHITE INFLUENCE - V162322 - How much influence do whites have in U.S. politics
recode V162322 (-9/-5=.)
gen wht_influence=(3-V162322)/2

* Here, we code for difference by race
gen difinf=wht_influence-blk_influence
gen difinfn=(difinf+1)/2

*********************** 2016 WHITENESS *************************

*** WHITE FEELING THERMOMETER ***
* V162314 - Using the thermometer scale 0-100, how would you rate whites
recode V162314 (-9/-5=.)
gen whitetherm=V162314
gen whitetherm1=V162314/100

*** WHITE DISCRIMINATION ***
* V162360 - How much discrimination is there in the US today against whites
* 5 point scale -* coded so that higher values = "a great deal" 
recode V162360 (-9/-6=.)
recode V162360 (-5=.)
gen whtdiscrim=(5-V162360)/4

*** WHITE IDENTITY (2012-2020 only) *** 
* V162327 - How important is being White to identity (avaail 2012-2020 only) 
* coded so that 1 = VERY important
recode V162327 (-9/-1=.)
gen whiteid=(5-V162327)/4

***WHITE LINKED FATE*** 
* not available in 2016

********************** 2016 XENOPHOBIA **************************

*** IMMIGRATION LEVELS *** THE ONLY POLICY MEASURE THAT IS CONSISTENT ACROSS YEARS. 
* coded so that 1 = xenophobic/favors decreased imm levels
recode V162157 (-9/-6=.)
gen immg=(V162157-1)/4
tab immg

*** BUILD WALL W MEXICO *** coded so that 1 indicates support for the Wall
recode V161196x (-9/-8=.)
gen build_wall=(7-V161196x)/6

***Muslim thermometer****
recode V162107 (-9/-4=.)
recode V162107  (998=.)
gen muslimtherm=V162107/100

***Latino thermometer
recode V162311 (-9/-4=.) 
recode V162311 (998=.)
gen latinotherm=V162311/100

*ILLEGAL IMMIGRANT THERMOMETER
recode V162313 (-9/-4=.) 
recode V162313 (998=.)
gen illegaltherm=V162313/100


*********************** 2016 GOVERNMENT & INSTITUTIONS ***************************

*** TRUST IN PEOPLE ***
* V161219 - Coded so that 1 = more trust
gen trustpf=(5-V161219)/4
replace trustpf=. if V161219==-9 | V161219==-8

*********************** 2016 ELECTION FAIRNESS ********************************** 

*** ELECTION FAIRNESS ***
* How often are votes counted fairly? (1 = system is fair)
recode V162219 (-9/-8=.) (-7/-6=.)
gen votefair=(5-V162219)/4
tab votefair 

***********************************************************************************************************************************************

*********************************** 2016 MODELS ***********************************************************************************************

eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
coefplot, drop(_cons) xline(0)

*F=1.18; p=0.3068
eststo: reg votefair c.whtdiscrim blackster trustpf authf c.pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
test c.pid3 c.whtdiscrim#c.pid3
quietly margins, at(whtdiscrim=(0(.5)1) pid3=(-1 0 1)) vce(unconditional)
marginsplot

****Appendix Table XX
eststo: reg votefair whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]


**R&R RObustness for Appendix
eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm latinotherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm latinotherm illegaltherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]


factor symrace blackster whitetherm1 whtdiscrim whiteid illegaltherm latinotherm muslimtherm immg if white==1, fac (2)
rotate

**************************************************************************************************************************************************

************************ 2012 WEIGHTS **********************************

*Weight (weights by mode and for full sample; below is for full sample)
gen wgt=weight_full

gen imode=mode-1
gen ftfwgt=weight_ftf
gen webwgt=weight_web

************************* 2012 DEMOGRAPHICS **************************

*** RACE ***
recode dem_raceeth (-9/-8=.)

*white (Non-Hispanic)
gen white=0
replace white=1 if  dem_raceeth==1
replace white=. if dem_raceeth==.

*** AGE ***
recode dem_agegrp_iwdate (-2=.)

gen age1829=0
replace age1829=1 if dem_agegrp_iwdate< 4
replace age1829=. if dem_agegrp_iwdate==.

gen age3044=0
replace age3044=1 if dem_agegrp_iwdate>=4 & dem_agegrp_iwdate<7
replace age3044=. if dem_agegrp_iwdate==.

gen age4564=0
replace age4564=1 if dem_agegrp_iwdate>=7 & dem_agegrp_iwdate<11
replace age4564=. if dem_agegrp_iwdate==.

gen age65p=0
replace age65p=1 if dem_agegrp_iwdate>=11
replace age65p=. if dem_agegrp_iwdate==.

*** GENDER *** 
gen female=0
replace female=1 if gender_respondent==2

gen male=1-female

*** EDUCATION ***
gen ba=0
replace ba=1 if dem_edugroup==4 | dem_edugroup==5
replace ba=. if dem_edugroup==-2 | dem_edugroup==-9

gen degree=(dem_edugroup-1)/4
replace degree=. if dem_edugroup==-2 | dem_edugroup==-9

*** INCOME ***
gen income=(incgroup_prepost)/28
replace income=0 if incgroup_prepost==-8 | incgroup_prepost==-9 

gen incdk=0
replace incdk=1 if incgroup_prepost==-8 | incgroup_prepost==-9

*** PARTY ID ***
gen partyid=pid_x-1
replace partyid=. if pid_x==-2
gen pid1=partyid/6

gen gop=1 if pid1>.5
replace gop=0 if pid1<.5 | pid1==.5
tab pid1 gop

gen pid3=0 if pid1==.5
replace pid3=-1 if pid1<.5
replace pid3=1 if pid1>.5
tab pid3 pid1

*** IDEOLOGY ***
recode libcpre_self (-9/-8=.)

gen ideology=libcpre_self-1
replace ideology=0 if libcpre_self==-2 | libcpre_self==.

gen ideoldk=0
replace ideoldk=1 if libcpre_self==-2 | libcpre_self==.

gen ideol1=ideology/6

*** SOUTH ***
gen south=0
replace south=1 if sample_state=="AL" | sample_state=="AR" | sample_state=="FL" | sample_state=="GA" |sample_state=="LA" | sample_state=="MS" | sample_state=="NC" | sample_state=="SC" | sample_state=="TN" | sample_state=="TX" | sample_state=="VA"
* label variable south "Reside in South"
* label values south yesno

*** PROTESTANT ***
gen prot=0
replace prot=1 if relig_7cat_x==1 | relig_7cat_x==2 | relig_7cat_x==3 | relig_7cat_x==5


************************* 2012 PERSONALITY **************************

*** AUTHORITARIANISM ***
* auth_ind - Qualities for children: Independent or respect elders
* auth_cur - Qualities for children: Curiosity or good manners
* auth_obed - Qualities for children: Obedience or self-reliance
* auth_consid - Qualities for children: Considerate or well behaved

recode auth_ind auth_cur auth_obed auth_consid (-9/-1=.)
recode auth_ind auth_cur auth_obed auth_consid (4=.)

gen auth1=0.5
replace auth1=0 if auth_ind==1
replace auth1=1 if auth_ind==2

gen auth2=0.5
replace auth2=0 if auth_cur==1
replace auth2=1 if auth_cur==2

gen auth3=0.5
replace auth3=0 if auth_obed==2
replace auth3=1 if auth_obed==1

gen auth4=0.5
replace auth4=0 if auth_consid==1
replace auth4=1 if auth_consid==2

egen authf=rowmean(auth1 auth2 auth3 auth4)

************************* 2012 RACIAL ATTITUDES **************************

*** SYMBOLIC RACISM/RACIAL RESENTMENT ***
* resent_workway - Blacks should work their way up like other groups
* resent_slavery - History makes more difficult for blacks to succeed
* resent_deserve - Blacks gotten less than they deserve
* resent_try - Blacks should try harder to succeed

recode resent_workway resent_slavery resent_deserve resent_try (-9/-1=.)
gen black1=(5-resent_workway)/4
gen black2=(resent_slavery-1)/4
gen black3=(resent_deserve-1)/4
gen black4=(5-resent_try)/4
egen symrace=rowmean(black1 black2 black3 black4)


*** BLACK FEELING THERMOMETER ***
* ftcasi_black - Using the thermometer scale 0-100, how would you rate blacks

recode ftcasi_black (-9/-6=.)
gen blacktherm=ftcasi_black
gen blacktherm1=ftcasi_black/100


*** NEGATIVE STEREOTYPES ***
** We code for difference between white and black indexed stereotypes
** Only Hardworking/Lazy and (Un)Intelligent are consistent across all years EXCEPT 2016
** Higher values are negative stereotypes

* stype_hwkwhite - Hardworking/Lazy 7-pt scale: whites
* stype_hwkblack - Hardworking/Lazy 7-pt scale: blacks
* stype_intwhite - Intellegent/Unintellegent 7-pt scale: whites
* stype_intblack - Intellegent/Unintellegent 7-pt scale: blacks

recode stype_hwkblack stype_hwkwhite stype_hwkhisp stype_hwkasian stype_intwhite stype_intblack stype_inthisp stype_intasian (-9/-6=.)

gen whitehw=(stype_hwkwhite-1)/6
gen blackhw=(stype_hwkblack-1)/6

gen whitein=(stype_intwhite-1)/6
gen blackin=(stype_intblack-1)/6

egen whitester=rowmean(whitehw whitein)
egen blackster=rowmean(blackhw blackin)

gen difstereo=blackster-whitester
gen difstereo1=(blackster-whitester+1.25)/2.41


*** POLITICAL INFLUENCE ***
* We code for difference by race
* racecasi_infwhite - How much influence do whites have in U.S. politics
* racecasi_infblacks - How much influence do blacks have in U.S. politics

recode racecasi_infblacks racecasi_infwhite (-9/-5=.)

gen whiteinf=(3-racecasi_infwhite)/2
gen blackinf=(3-racecasi_infblacks)/2

gen difinf=whiteinf-blackinf
gen difinfn=(difinf+1)/2


************************** 2012 WHITENESS *************************

*** WHITE FEELING THERMOMETER ***
* ftcasi_white - Using the thermometer scale 0-100, how would you rate whites
recode ftcasi_white (-9/-5=.)
gen whitetherm=ftcasi_white
gen whitetherm1=ftcasi_white/100

*** WHITE DISCRIMINATION *** 
* coded so that higher values = "a great deal" 
recode discrim_whites (-9/-6=.)
gen whtdiscrim=(5-discrim_whites)/4

*** WHITE IDENTITY (2012-2020 only) ***
* coded so that 1 = VERY important
recode ident_whiteid (-9/-1=.)
gen whiteid=(5-ident_whiteid)/4

*** WHITE LINKED FATE ***
* link_white - coded as a binary variable, but could include the don't knows in a scale ??
* Are you affected by what happens to whites? 1 = yes
recode link_white (-9/-1=.)
gen whtlink = link_white
replace whtlink=1 if link_white==1
replace whtlink=0 if link_white==2

************************* 2012 XENOPHOBIA **************************

* THE ONE ITEM THAT EXISTS THROUGHOUT IS THE IMMIGRAITON LEVELS POLICY MEASURE. 
* Coded so that 1 = more xenophobic

recode immigpo_level (-9/-6=.)
gen immg=(immigpo_level-1)/4
tab immg

**Mulsim thermometer
recode ftgr_muslims (-9/-4=.)
recode ftgr_muslims  (998=.)
gen muslimtherm=ftgr_muslims/100

***Latino thermometer
**N/A

*ILLEGAL IMMIGRANT THERMOMETER
**N/A

*********************** 2012 GOVERNMENT & INSTITUTIONS ***************************

*** TRUST IN PEOPLE ***
* trustpf - Would R say most people can be trusted
* trust_social DIFFERENT QUESTION WITH DIFFERENT RESPONSE OPTIONS
gen trustpf=(5-trust_social)/4
replace trustpf=. if trust_social==-9 | trust_social==-8


*********************** 2012 ELECTION FAIRNESS **********************************

** Votes Counted Fairly **
* electintpo_countfair coded so that 1 = votes are counted fairly 
recode electintpo_countfair (-9/-8=.)
recode electintpo_countfair (-7/-6=.)
gen countfair=(4-electintpo_countfair)/3
gen votefair=countfair

** Electioon Officals are Fair **
* electintpo_elecofffair coded so that 1 = often fair
recode electintpo_elecofffair (-9/-8=.)
recode electintpo_elecofffair (-7/-6=.)
gen officialfair=(4-electintpo_elecofffair)/3

**alpha=0.72
alpha votefair officialfair if white==1
egen indexfair= rowmean(votefair officialfair)


******************************************************************************************************************************************************

************************ 2012 MODELS *****************************************************************************************************************

eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
coefplot, drop(_cons) xline(0)
eststo: reg officialfair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
coefplot, drop(_cons) xline(0)

eststo: reg votefair c.whtdiscrim blackster trustpf authf c.pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]

quietly margins, at(whtdiscrim=(0(.5)1) pid3=(-1 0 1)) vce(unconditional)
marginsplot

eststo: reg officialfair c.whtdiscrim blackster trustpf authf c.pid3 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg officialfair c.whtdiscrim##c.pid3  blackster trustpf authf ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]

quietly margins, at(whtdiscrim=(0(.5)1) pid3=(-1 0 1)) vce(unconditional)
marginsplot

****** Appendix Tables *******************************
eststo: reg votefair whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg officialfair whiteid blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg officialfair whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]


** R&R Robustness for Appendix
eststo: reg votefair whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]
eststo: reg votefair whtdiscrim whiteid whitetherm muslimtherm immg symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [pw=wgt]

****************************************************************************************************************************

********************** 2016-2020 PANEL MODELS ******************************************************************************


eststo: reg votefair_20 votefair_16 whtdiscrim blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

eststo: reg votefair_20 votefair_16 whtdiscrim symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

eststo: reg votefair_20 votefair_16 whtdiscrim whiteid whitetherm blackster trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

eststo: reg votefair_20 votefair_16 whtdiscrim whiteid whitetherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

eststo: reg votefair_20 votefair_16 whtdiscrim whiteid whitetherm muslimtherm symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

eststo: reg votefair_20 votefair_16 whtdiscrim whiteid whitetherm muslimtherm immg symrace trustpf authf pid1 ideol1 ideoldk female age3044 age4564 age65p degree income incdk prot if white==1 [aw=wgt]

